package org.haredot.web;

import java.util.HashMap;
import java.util.Map;

public class ModelAndView {
    /**
     * 用来存储视图名
     */
    private String viewName ;

    /**
     * 存储所有的数据
     */
    private final Map<String, Object> data = new HashMap<>();

    public ModelAndView() {}

    public ModelAndView(String viewName) {
        this.viewName = viewName ;
    }

    public String getViewName() {
        return viewName;
    }

    public void setViewName(String viewName) {
        this.viewName = viewName;
    }

    public void addObject(String key, Object value) {
        data.put(key, value) ;
    }

    public Map<String, Object> getData() {
        return data;
    }
}
